import cv2 as cv

img = cv.imread(r'E:\picture\Lena.jpg')

#BGR分量
cv.imshow("source", img)
cv.imshow("BGR-BLUE", img[:, :, 0])
cv.imshow("BGR-GREEN", img[:, :, 1])
cv.imshow("BGR-RED", img[:, :, 2])
cv.waitKey()
cv.destroyAllWindows()

#HHSV分量
hsv = cv.cvtColor(img, cv.COLOR_BGR2HSV)
cv.imshow("source", img)
cv.imshow("hue", hsv[:, :, 0])
cv.imshow("Saturation", hsv[:, :, 1])
cv.imshow("Value", hsv[:, :, 2])
cv.waitKey()
cv.destroyAllWindows()
